In article <32quct$2pg@darkstar.UCSC.EDU>, zorro <zorro@cats.ucsc.edu> wrote:
>
>
>Constantly I find myself in the situation that Dina described... not knowing
>where to look for a particulat #define, variable, or function.
>So what I end up doing is uploading whole directories to my trusty Sparc
>and using the 'grep' command. I realize this is wrong on a very basic level
>and so what I want to ask is, does anyone know of an MPW Tool that duplicates
>the functionality of 'grep'?
>I could write one myself, all it would have to do is look through .c and .h
>files for a text pattern, but I would prefer it if I didn't have to.
>
>So, has anyone out there implemented 'grep'??
>
>- Dan
>
If you are working in MPW, there are tools you can use to accomplish the
same effect (though it's not as nice as grep IMHO). The "files" tool
will list all the files in the specified directory, while the "search"
tool will search all the given files for the specified pattern.
In my worksheet, I have the following line marked as "Search in includes":
search -s /Gestalt/ `files -o -f -t TEXT "{mpw}"Interfaces:CIncludes`
This will search through all the MPW C header files for the given pattern.
In this case, it is searching for Gestalt. To search for something else,
just change what's inside the '/' delimiters. To search a different
directory, replace the "{mpw}"Interfaces:Cincludes with the directory
of your choice. You can also specify the -r option to the files tool,
which will make the search recursively descend into subdirectories.
Hope that helps.
-Jon
+++++++++++++++++++++++++++
>From timothys@hood.uucp (Timothy Sherburne)
Date: 17 Aug 94 16:37:32 GMT
Organization: University of Portland
Bruce@hoult.actrix.gen.nz (Bruce Hoult) writes:
>zorro@cats.ucsc.edu (zorro) writes:
>> Constantly I find myself in the situation that Dina described... not knowing
>> where to look for a particulat #define, variable, or function.
>> So what I end up doing is uploading whole directories to my trusty Sparc
>> and using the 'grep' command. I realize this is wrong on a very basic level
>> and so what I want to ask is, does anyone know of an MPW Tool that duplicates
>> the functionality of 'grep'?
>> I could write one myself, all it would have to do is look through .c and .h
>> files for a text pattern, but I would prefer it if I didn't have to.
>What's wrong with "search"? Name too obscure, or something?
> search CloseWindow "{cincludes}"≈.h
>-- Bruce
All these suggestions to use the "search" tool are fine, but you can also install the "poptag" tool (found on the May '94 Tool Chest CD, but I couldn't find it on ETO 15 :(
It works like this: highlight some function name, etc. and type cmd-P. The definition will be given.
Works well IF you've got some extra space on your HD and the time to install it.
t
--
| Timothy Sherburne | Software Engineer |
| Internet: timothys@uofport.edu | Prometheus Products, Inc. |